package com.red5;



import java.util.List;

import org.red5.server.api.IScope;
import org.red5.server.api.so.ISharedObject;
import org.red5.server.api.so.ISharedObjectSecurity;




import com.woa.Application;

  public class MySecurityHandler implements ISharedObjectSecurity
  {
	  public Application appli;
	  
	  public MySecurityHandler(Application _appli)
	  {
		  this.appli = _appli;
	  }
	  
	  public boolean isCreationAllowed(IScope scope, String name, boolean persistent)
	  {
	    if ("tempo".equals(name))
	    {
	      appli.world.mytime.create_tempo();
	    }
	    if ("woalshare".equals(name))
	    {
	      appli.world.woal.woaobject_screen_share();
	    }	    
	    return true;
	  }
	  
@Override
public boolean isConnectionAllowed(ISharedObject arg0) {
	// TODO Auto-generated method stub
	return true;
}

@Override
public boolean isDeleteAllowed(ISharedObject arg0, String arg1) {
	// TODO Auto-generated method stub
	return false;
}

@SuppressWarnings("unchecked")
@Override
public boolean isSendAllowed(ISharedObject arg0, String name, List arg2) {
	// TODO Auto-generated method stub
	if ( "tempo".equals(name) ) return true;
	if ( "woalshare".equals(name) ) return true;
	return false;
}

@Override
public boolean isWriteAllowed(ISharedObject arg0, String arg1, Object arg2) {
	// TODO Auto-generated method stub
	return false;
}



}
